package single;

/**
 * @author GongXincheng
 * @since 2019-08-02 18:54
 */
public class Demo3 {

    private Demo3() {}

    private static class Demo3Handler {
        private static Demo3 instance = new Demo3();
    }

    public static Demo3 getInstance() {
        return Demo3Handler.instance;
    }

    public static void main(String[] args) {
        Demo3 instance1 = Demo3.getInstance();
        Demo3 instance2 = Demo3.getInstance();
        System.out.println(instance1 == instance2);
    }
}
